<%@page import="com.gxuwz.medical.domain.family.Family"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/common/base.jsp"%>
<%
  //获取家庭编号参数
  String famicode=request.getParameter("id");
  //根据家庭编号查找家庭档案信息
  Family family =new Family(famicode);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<link rel="stylesheet" type="text/css" href="css/admin.css">
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/admin.js"></script>
<!-- 引入第三方日期JS组件 -->
<script type="text/javascript" src="third/laydate/laydate.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		//重新绑定表单提交
		$("#add_btn").bind("click", function() {
			$('form').submit();
		});
	});
	//选择不同的村组
	function chooseGroup(){
		var val=$("#village").val();
		$.ajax({
			   type: "POST",
			   url: "<%=path%>/system/AreaServlet?m=groupList",
			   data: {"villageID":val},
			   dataType:"json",
			   success: function(data){
				 $("#group").empty();
			     $.each(data,function(i,val){
			    	 $("#group").append("<option value='"+val.areacode+"'>"+val.areaname+"</option>");
			     });
			   }
			});
	}
</script>

</head>

<body>

	<div class="panel admin-panel">
		<div class="panel-head" id="add">
			<strong><span class="icon-pencil-square-o"></span>增加家庭成员信息</strong>
		</div>
		<div class="body-content">
			<form id="form-add" method="post" 
				action="<%=path%>/system/FamilyServlet?m=addMember">
				
				<div class="form-x">
				<div class="form-group">
						<div class="label">
							<label>家庭编号：</label>
						</div>
						<div class="field">
							<input type="text" id="famicode" name="famicode" value="<%=famicode %>" readonly="readonly" class="input w50"/>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>成员姓名：</label>
						</div>
						<div class="field">
							<input type="text" id="persname" name="persname" value="钟海山" class="input w50"/>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>与户主关系：</label>
						</div>
						<div class="field">
							<select id="relation" name="relation" class="input w50">
								
								<option value="2" <% if(family.getPopuNum()==1){ %>selected="selected"<%}%>>配偶</option>
								<option value="3" <% if(family.getPopuNum()>2){ %>selected="selected"<%}%>>子女</option>
								<option value="4">父母</option>
								<option value="5">外甥女</option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
						<div class="form-group">
						<div class="label">
							<label>身份证号：</label>
						</div>
						<div class="field">
							<input type="text" id="cardID" name="cardID" value="450421195
108247000" class="input w50"/>
							<div class="tips"></div>
						</div>
					</div>
						<div class="form-group">
						<div class="label">
							<label>出生年月：</label>
						</div>
						<div class="field">
							<input type="text" id="birthday" name="birthday" value="1969-10-01" class="input w50"/>
							<div class="tips"></div>
						</div>
					</div>
					
					<div class="form-group">
						<div class="label">
							<label>性别：</label>
						</div>
						<div class="field">
							<select id="sex" name="sex" class="input w50">
								<option value="1">男</option>
								<option value="2">女</option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
						<div class="form-group">
						<div class="label">
							<label>人员属性：</label>
						</div>
						<div class="field">
							<select id="persPro" name="persPro" class="input w50">
								<option value="1">一般户</option>
								<option value="2">民政救助对象</option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>是否农村户口：</label>
						</div>
						<div class="field">
							<select id="isRural" name="isRural" class="input w50">
								<option value="1">是</option>
								<option value="0">否</option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>职业：</label>
						</div>
						<div class="field">
							<select id="occupation" name="occupation" class="input w50">
								<option value="1">农民</option>
								<option value="2">工人</option>
								<option value="3">学生</option>
								<option value="9">其他</option>
							</select>
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>工作单位：</label>
						</div>
						<div class="field">
							<input type="text" id="workUnit" name="workUnit" class="input w50"  value="<%=family.getAddress()%>">	
							<div class="tips"></div>
						</div>
					</div>
					<div class="form-group">
						<div class="label">
							<label>常住地址：</label>
						</div>
						<div class="field">
							<input type="text" id="liveAddress" name="liveAddress" class="input w50" value="<%=family.getAddress()%>">	
							<div class="tips"></div>
						</div>
					</div>
						<div class="form-group">
						<div class="label">
							<label>联系电话：</label>
						</div>
						<div class="field">
							<input type="text" id="telephone" name="telephone" value="13471402595" class="input w50">	
							<div class="tips"></div>
						</div>
					</div>
					
					<div class="form-group">
						<div class="label">
							<label></label>
						</div>
						<div class="field">
							<button id="add_btn" class="button bg-main icon-check-square-o"
								type="button">提交</button>
						</div>
					</div>
					</div>
			</form>
		</div>
	</div>
<!--渲染JS日期组件 -->
<script type="text/javascript">
 laydate.render({
  elem: '#birthday'
});
</script>
</body>
</html>
